﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OracleClient;

namespace CardLogistics.DAL
{
    /// <summary>
    /// 综合报表
    /// </summary>
    public class DepReportData
    {
        #region 技术部报表
        /// <summary>
        /// 月盘点表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable GetJMonthInv(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetJMInv", parameters);
        }
        #endregion

        #region 成品库报表
        /// <summary>
        /// 成品库月盘点表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable GetCPMonthSta(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetCPMonthSta", parameters);
        }
        #endregion

        #region 成品库预充值月报表
        /// <summary>
        /// 成品库预充值月报表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable CP_MonthPre(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetCPMonthPre", parameters);
        }
        #endregion

        #region 成品退换卡片统计月报表
        /// <summary>
        /// 成品退换卡片统计月报表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable GetCPReturnMonthSta(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetCPReturnMonthSta", parameters);
        }
        #endregion

        #region 问题卡片成本摊销表
        /// <summary>
        /// 问题卡片成本摊销表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable GetCAmortize(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetCAmortize", parameters);
        }
        #endregion

        #region 运营部卡片统计月报表
        /// <summary>
        /// 运营部卡片统计月报表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable GetYCorpMonthSta(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetYCorpMonthSta", parameters);
        }
        #endregion

        #region 运营部明细月报表
        /// <summary>
        /// 运营部明细月报表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable GetYSaleMonthDetl(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetYSaleMonthDetl", parameters);
        }
        #endregion

        #region 技术部退卡盘点统计月报表
        /// <summary>
        /// 技术部退卡盘点统计月报表
        /// </summary>
        /// <param name="startValue">统计开始日期</param>
        /// <param name="endValue">结束日期</param>
        /// <returns>返回结果集DataTable</returns>
        public DataTable GetJReturnMonthSta(string startValue, string endValue)
        {
            OracleParameter[] parameters = {
                                            new OracleParameter("vstartdata", OracleType.VarChar),
                                            new OracleParameter("venddata", OracleType.VarChar),
                                            new OracleParameter("curArg", OracleType.Cursor)
                                         };
            parameters[0].Value = startValue;
            parameters[1].Value = endValue;
            parameters[2].Direction = ParameterDirection.Output;
            return DbHelperSQL.FillDataTable(CommandType.StoredProcedure, "P_Rep_GetJReturnMonthSta", parameters);
        }
        #endregion
    }
}
